package cn.com.greatwall.gateway.feign;

import java.util.List;
import java.util.concurrent.Future;

import javax.annotation.Resource;

import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Component;

import cn.com.greatwall.common.model.SysMenu;

/**
 * @Author herw
 * @Time 2022-02-12 10:43:47
 * @Version 1.0
 * @Description: 异步Menu服务
 */
@Component
public class AsynMenuService {
    @Lazy
    @Resource
    private MenuService menuService;

    @Async
    public Future<List<SysMenu>> findByRoleCodes(String roleCodes) {
        List<SysMenu> result = menuService.findByRoleCodes(roleCodes);
        return new AsyncResult<>(result);
    }
}
